import type {
  PageBookingByState,
  QueryAddBooking,
  QueryPageBookingByState,
  Result,
} from '@/config/data/data'
import { get, post } from './request'

/**
 * 根据状态分页查询
 * @param data 参数对象
 * @returns 多条信息
 */
export const ReqSelectBookingPageByState = (
  data: QueryPageBookingByState
): Promise<Result<PageBookingByState[]>> => get('/booking/page/state', data)


/**
 * 取消预约
 * @param data 参数对象
 * @returns 多条信息
 */
export const ReqCancelBooking = (
  data: {id:number}
): Promise<Result<boolean>> => get('/booking/cancel', data)


/**
 * 新增预约
 * @param data 参数对象
 * @returns 多条信息
 */
export const ReqAddlBooking = (
  data: QueryAddBooking
): Promise<Result<boolean>> => post('/booking/add', data)
